package com.witmed.service.impl;

import java.util.List;

/**
 * 科室表
 * 
 * @author chenxiangyang
 *
 */
import com.witmed.dao.DepartmentDao;
import com.witmed.dao.impl.DepartmentDaoImpl;
import com.witmed.entity.Department;
import com.witmed.entity.Hospital;
import com.witmed.service.DepartmentService;

public class DepartmentServiceImpl implements DepartmentService {

	private DepartmentDao departmentDao = new DepartmentDaoImpl();

	/**
	 * 科室插入
	 */
	@Override
	public boolean insertDepartment(Department department) {
		// TODO Auto-generated method stub
		return departmentDao.insertDepartment(department) > 0 ? true : false;
	}

	/**
	 * 根据医院id查询科室信息
	 */
	@Override
	public List<Department> getByHospitalId(Hospital hospitalId) {
		// TODO Auto-generated method stub
		return departmentDao.getfindByDoctorId(hospitalId);
	}

	/**
	 * 根据医院id删除科室
	 */

	@Override
	public boolean deleteByDepartmentId(int hospitalId) {
		// TODO Auto-generated method stub
		int i = departmentDao.deleteByDepartmentId(hospitalId);
		return i > 0 ? true : false;
	}

}
